﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
layout:decorator="layout">
<head>
  <title>账户管理</title>
</head>
<body>
<div layout:fragment="content">
		<div class="detail">
			<div class="form-background" id="accountHtml">
				<div class="receivable-setting-item">
					<p style="font-size:18px;padding:20px;">品牌设置</p>
					<form id="brandForm" style="margin-top: 20px;">
						<div class="form-group">
							<label class="form-label-new">品牌：</label>
							<div class="form-tip-wrapper">
								<input type="text" name="title" th:value="${data.title}"  class="input-newlarge changecolor" placeholder=""/>
								<div id="titleTip" class="form-tip-error"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="form-label-new">链接：</label>
							<div class="form-tip-wrapper">
							<input type="text" name="url" th:value="${data.url}" class="input-newlarge changecolor" placeholder=""/>
							<div id="urlTip" class="form-tip-error"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="form-label-new">LOGO：</label>
							<div class="form-tip-wrapper">
							<div id="pic" class="pp-logo" style="display: inline-block;">
							</div>
							<div id="picTip" class="form-tip-error"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="form-label-new">介绍内容：</label>
							<div class="form-tip-wrapper pp-des">
							<textarea rows="3" name="description" style="width:630px;" id="description"></textarea>
							<div id="descriptionTip" class="form-tip-error"></div>
							</div>
						</div>
							
						<div class="form-group">
							<label class="form-label-w-112"></label>
							<input type="submit" value="提交" class="input-submit-03"/>
						</div>
					</form>
				</div>
			</div>
		</div>
		<script type="text/javascript" th:inline="javascript">
		/*<![CDATA[*/
		    var data = /*[[${data}]]*/
			;$(function() {
				setMenu("品牌机构", true);
				if(data.isBrandOrg == null || !data.isBrandOrg){
					$('.detail').css("display","none");
					$.jjalert({text:"你还不是品牌机构，请联系客服",yes:function(){
						location.href="../index/index"
					}});
				} else {
					$("#brandTemp").before($.loadData({html:$("#brandTemp").html(),data:data}));
					$("#brandForm").formsubmit({url:"brand-save",type:"post",success:function(){
						$.jjalert({text:"品牌设置成功", yes:function(){
							location.href="../acc/brand";
						}});
					}});
					$("#pic").jjUploadClipFile({width:120,height:120,url:data.pic});///LOGO
					$("#description").umeditor(data.description);
					$.formValidator.initConfig({formID:"brandForm",debug:false,onError:function(msg){}});
					$("#brandForm input[name='title']").formValidator({tipID:"titleTip",onShow:"",onFocus:"",onCorrect:""}).inputValidator({min:1,max:6,onError:"请输入6字符以内"});
					$("#brandForm input[name='url']").formValidator({tipID:"urlTip",onShow:"",onFocus:"",onCorrect:""}).regexValidator({regExp:"url",dataType:"enum",onError:"格式不正确例如：http://www.baidu.com"});
					$("#brandForm input[name='pic']").formValidator({tipID:"picTip",onShow:"",onFocus:"",onCorrect:""}).inputValidator({min:1,onError:"请选择图片"});
				}
				$('.changecolor').focus(function() {
		      	    $(this).css('border-color', '#FF6121');
		      	  }).blur(function() {
		      	    $(this).css('border-color', '');
		      	  });
			});
		/*]]>*/
		</script>
</div>
</body>
</html>